/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ca.jerg.app;

import javax.swing.ImageIcon;

/**
 *
 * @author dave
 */
public class ErgIcons
{	
	public static ImageIcon createLargeIcon( String type, String name)
	{
		return createIcon(type,name,"24");
	}

	public static ImageIcon createSmallIcon( String type, String name )
	{
		return createIcon(type,name,"16");
	}

	private static ImageIcon createIcon( String type, String name, String size )
	{
		if ( (type == null) || (name == null) )
			return null;
		
		String imgLocation = type + name + size + ".gif";
		java.net.URL imageURL = ErgIcons.class.getResource(imgLocation);

		if (imageURL == null) 
		{
			System.err.println("Resource not found: " + imgLocation);
			return null;
		} 
		
		return new ImageIcon(imageURL);
	}
	
	public static String GENERAL = "/toolbarButtonGraphics/general/";
	public static String MEDIA = "/toolbarButtonGraphics/media/";
	public static String NAVIGATION = "/toolbarButtonGraphics/navigation/";
	public static String TABLE = "/toolbarButtonGraphics/table/";
	public static String TEXT = "/toolbarButtonGraphics/text/";
}
